package io.renren;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;


@SpringBootApplication
@MapperScan(basePackages = {"io.renren.dao"})
@EnableTransactionManagement
@com.cxytiandi.encrypt.springboot.annotation.EnableEncrypt
public class ApiApplication extends SpringBootServletInitializer {

	public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(ApiApplication.class, args);
//        FileServerConfig fileServerConfig = applicationContext.getBean(FileServerConfig.class);
//        System.out.println(fileServerConfig.getDeleteFileUrl());
    }

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(ApiApplication.class);
	}

//    @Bean
//    public Object testBean(PlatformTransactionManager platformTransactionManager){
//        System.out.println(">>>>>>>>>>" + platformTransactionManager.getClass().getName());
//        return new Object();
//    }
}
